#!/usr/bin/env php
<?php

define('APP_PATH', __DIR__ . DIRECTORY_SEPARATOR);

// 注入外部项
require dirname(APP_PATH).DIRECTORY_SEPARATOR.'bootstrap.php';

// RUNTIME_PATH 分 app 存储 
define('RUNTIME_PATH', L_WORKSPACE_PATH.DIRECTORY_SEPARATOR."runtime".DIRECTORY_SEPARATOR.L_APP_NAME.DIRECTORY_SEPARATOR);
define('EXTEND_PATH', APP_PATH."extend".DIRECTORY_SEPARATOR);
define('CONF_PATH', APP_PATH."conf".DIRECTORY_SEPARATOR);

// ThinkPHP 引导文件
// 加载基础文件
require L_WORKSPACE_PATH . 'thinkphp'.DIRECTORY_SEPARATOR.'base.php';

// 引入进thinkPHP框架 
\think\App::initCommon();

require SHARE_PATH."console/CConsole.php";

if (substr(php_sapi_name(), 0, 3) != 'cli') 
{
	echo "only can run as cli!";
	die("\n");
}

$args=array_slice($argv, 1);

\share\console\CConsole::run($args);